const db = require('../config/db');
// 测试数据库查询语句

const title = 'HTML5权威指南';

// const totalSql = 'select count(*) as total from video where del=0 and title=?';
// db.query(totalSql, title, (err, resTotal) => {
//     console.log(resTotal[0].total);
// });

const userListSql = 'select * from user order by id limit ?,?';

// db.query(userListSql, [0, 3], (err, result) => {
//   result.map((item) => {
//     item.pwd = '';
//   });
//   //   console.log(result);
// });

const userTotalSql = 'select count(*) as total from user';

db.query(userTotalSql, (err,result) => {
  console.log(result[0].total);
});
